package tgc.edu.ljc.bootstrap.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import tgc.edu.ljc.bootstrap.entity.Grade;
import tgc.edu.ljc.bootstrap.entity.SysUser;
import tgc.edu.ljc.bootstrap.security.UserUtils;
import tgc.edu.ljc.bootstrap.service.GradeService;

@Controller
@RequestMapping(value = "/grade")
public class GradeController {
	@Autowired
	private GradeService gradeService;
	@Autowired
	private UserUtils userUtils;
	
	@RequestMapping(value = "/peasonGrade")
	public String peasonGrade(ModelMap modelMap) {
		SysUser user = userUtils.getUser();
		Integer id = user.getId();
		List<Grade> list = gradeService.findByStudentId(id);
		modelMap.put("list", list);
		return "grade/peasonGrade";
	}
}
